let all_group = document.querySelectorAll('.home-brick-box');
let id = 1;

let res = '';

for (let i = 0; i < all_group.length; i++) {
    let group = all_group[i];
    let group_name = group.querySelector('.title').innerText;
    let brick_list = group.querySelector('.brick-list');
    let names = brick_list.querySelectorAll('h3.title');
    for (let j = 0; j < names.length; j++) {
        let s = `{ id: ${id}, name: '${names[j].innerText}', imgUrl: '/img/${id}.png', group: '${group_name}' },\n`;
        res += s;
        id++;
    }
}

console.log(res);